package com.gmail.liulijuan.Busyness;

import java.util.ArrayList;

import com.gmail.liulijuan.DB.Custom;
import com.gmail.liulijuan.DB.CustomDao;
import com.gmail.liulijuan.DB.Employee;
import com.gmail.liulijuan.DB.EmployeeDao;

public class CustomAdd {
	public boolean InsertCustom(String CustomName,String Sex,String PhoneNumber){
		int result=0;
		Custom ct=new Custom();		
		ct.setCustomName(CustomName);		
		ct.setSex(Sex);		
		ct.setPhoneNumber(PhoneNumber);
		CustomDao cd=new CustomDao();
		result=cd.InsertCustom(ct);

		return result==1?true:false;
	}
	public boolean UpdataCustom(ArrayList al){
	
		CustomDao cd=new CustomDao();
		int n=0;
		for (int i = 0; i < al.size(); i++) {
			cd.UpdataCustom((Custom)al.get(i));
			n=n+1;
			
		}
		return n==al.size();
	}

}
